class Solution {
    public String mergeAlternately(String word1, String word2) {
       char[] arr = new char[word1.length()+word2.length()];
                    

      for(int i = 0 ,len1= 0 ,len2 =0; i < arr.length ; ){
          if(len1 < word1.length()){
             arr[i] = word1.charAt(len1);
             len1 ++;
             i++;
          }
          if(len2 < word2.length()){
           arr[i] = word2.charAt(len2);
              len2++;
              i++;
          }
      }     

       return new String(arr );


    }
}